----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/table_A4_phi_vs_z_byyear.log
  log type:  text
 opened on:  22 Nov 2022, 10:23:43

. *-------------------------------------------------------------------------------
. 
. 
. *Creating a placeholder dataset
. *----------------------------------------------
. clear all

. set obs 100
number of observations (_N) was 0, now 100

. gen year=.
(100 missing values generated)

. local iter=0

. forvalues year=2006(1)2017 {
  2. display "`year'"
  3. local iter=`iter'+1
  4. replace year=`year' if _n==`iter'
  5. }
2006
(1 real change made)
2007
(1 real change made)
2008
(1 real change made)
2009
(1 real change made)
2010
(1 real change made)
2011
(1 real change made)
2012
(1 real change made)
2013
(1 real change made)
2014
(1 real change made)
2015
(1 real change made)
2016
(1 real change made)
2017
(1 real change made)

. gen coef=.
(100 missing values generated)

. gen se=.
(100 missing values generated)

. gen num_ctry=.
(100 missing values generated)

. gen coef_cttesample=.
(100 missing values generated)

. gen se_cttesample=.
(100 missing values generated)

. gen num_ctry_cttesample=.
(100 missing values generated)

. 
. tempfile phi_byyear

. save `phi_byyear', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved

. 
. 
. 
. *-----------------------------------------------------------------
. *Table A4 (part a): coef and standard error per year, for all firms
. *-----------------------------------------------------------------
. local nn=10 

. *minimum number of sectors allowed per year-isocode*/
. clear all

. use "${data}/estimates_sec_naics_sales_s1_base_woparent.dta", clear

. by year isocode, sort: egen num=count( fe_location )

. table isocode year, c(mean  num)

----------------------------------------------------------------------------------
          |                                  year                                 
  isocode | 2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017
----------+-----------------------------------------------------------------------
       AT |    8    11    14    14    18    18    18    18    17    17    17    16
       BE |   14    16    18    18    18    18    18    18    18    19    19    19
       BG |    8    10    17    17    17    17    17    17    17    17    17    17
       CZ |   15    17    18    18    18    18    18    18    18    18    18    17
       DE |   17    18    18    18    18    18    18    18    19    19    19    19
       DK |          3     4     4     4     4     6    18    18    18    18    18
       EE |    3    12    17    17    17    17    17    17    17    17    17    17
       ES |   17    18    18    18    18    18    18    18    18    18    18    18
       FI |   11    15    18    18    18    18    18    18    18    18    18    18
       FR |   17    18    18    18    18    18    18    18    18    18    18    18
       GB |   16    16    18    18    18    18    18    18    18    18    18    18
       GR |    9    17    17    17    17    17    17    17    18    18    17    16
       HR |    9    12    17    17    17    17    17    17    17    17    17    17
       HU |   13    17    18    18    18    18    18    18    18    18    18    18
       IT |   15    18    18    18    18    18    18    18    18    18    18    18
       JP |    9    10    11    10    11    12    13    13    13    14    15    14
       KR |   13    12    16    17    17    17    16    16    17    17    17    16
       LT |    2    12    17    17    17    17    17    17    17    17    17    17
       LV |    5     8    18    18    17    17    18    17    18    18    17    17
       MX |    2     4     7     9     7     9     9    15    15    16    15    13
       NL |   14    17    18    18    18    18    18    18    18    18    18    18
       PL |   17    18    18    18    18    18    18    18    18    18    18    17
       PT |   16    18    18    18    18    18    18    18    18    18    18    18
       RO |   15    17    19    19    19    19    19    19    19    19    19    19
       SE |   14    17    19    19    19    19    19    19    19    19    19    19
       SI |    7    12    16    16    18    18    18    18    18    18    18    18
       SK |    8    15    18    18    18    18    18    18    18    18    18    17
----------------------------------------------------------------------------------

. keep if num>=`nn'
(153 observations deleted)

. keep year isocode

. duplicates drop 

Duplicates in terms of all variables

(4,853 observations deleted)

. tempfile iso

. save `iso', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000l.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000l.tmp saved

. 
. use "${data}/estimates_agg_naics_sales_s1_base_woparent.dta", clear

. merge m:1 year isocode using `iso'

    Result                           # of obs.
    -----------------------------------------
    not matched                            24
        from master                        24  (_merge==1)
        from using                          0  (_merge==2)

    matched                               299  (_merge==3)
    -----------------------------------------

. keep if _merge==3
(24 observations deleted)

. drop _merge

. tempfile file_byyear

. save `file_byyear', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000m.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000m.tmp saved

. 
. 
. *-----------------------------------------------------------------
. clear all

. use `file_byyear', clear

. 
. local grvar0 "gdp_pw_ppp" 

. local grvar1 "" 

. local rr ""

. local var3 "A"

. keep if year>=2006 & year<=2017
(0 observations deleted)

. merge m:1 year isocode type using "${data}/aggregates_tfp_lp_klems_agg.dta" 
(note: variable year was float, now double to accommodate using data's values)
(note: variable isocode was str2, now str32 to accommodate using data's values)
(note: variable type was str5, now str9 to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                         2,713
        from master                         0  (_merge==1)
        from using                      2,713  (_merge==2)

    matched                               299  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(2,713 observations deleted)

. drop _merge

. 
. foreach var in D_A  {
  2. gen `var'_phi=(-1)*`var'*(0.2)
  3. *---------------------------------------
. gen b_`var'_phi_`grvar0'=ln_`grvar0' - `var'_phi
  4. }

. 
. local LHS1 D_`var3'_phi

. local LHS2 b_D_`var3'_phi_`grvar0'

. local RHS ln_`grvar0'

.         
. sum `LHS1' `RHS'  `LHS2'

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     D_A_phi |        299   -.1978698    .1683657  -.6395221    .187459
ln_gdp_pw_~p |        299    -.331689    .2859037  -1.131054   .0762673
b_D_A_phi_~p |        299   -.1338192    .2347525  -.8328779   .4057999

. local ytitle "{&Delta}`=ustrunescape("\u03D5\u0303")'{sub:n}, {&Delta}`=ustrunescape("\u007A\u0303")'{sub:n}"

. local xtitle "{&Delta}y{sub:n}"

. local firm_emb "{&Delta}`=ustrunescape("\u03D5\u0303")'{sub:n}" 

. local ctry_emb "{&Delta}`=ustrunescape("\u007A\u0303")'{sub:n}"

. 
. tempfile temp

. save `temp', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000n.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000n.tmp saved

. 
. 
. 
. forvalues year=2006(1)2017 {
  2. display "`year'"
  3. 
. use `temp', clear
  4. reg `LHS1' `RHS' if year==`year'
  5. mat b = e(b)
  6. mat V = e(V)
  7. global c1: display %-03.2fc round(b[1,1],0.01)
  8. global se1: display %-03.2fc round(sqrt(V[1,1]),0.01)
  9.         
. use  `phi_byyear', clear
 10. replace coef=$c1 if year==`year'
 11. replace se=$se1 if year==`year'
 12. replace num_ctry=`e(N)' if year==`year'
 13. save, replace
 14. 
. }
2006

      Source |       SS           df       MS      Number of obs   =        15
-------------+----------------------------------   F(1, 13)        =      3.72
       Model |  .111325541         1  .111325541   Prob > F        =    0.0758
    Residual |  .388846553        13  .029911273   R-squared       =    0.2226
-------------+----------------------------------   Adj R-squared   =    0.1628
       Total |  .500172094        14  .035726578   Root MSE        =    .17295

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .2808009   .1455521     1.93   0.076    -.0336453    .5952472
        _cons |  -.0361779   .0589335    -0.61   0.550    -.1634959    .0911401
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2007

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     12.04
       Model |  .315870173         1  .315870173   Prob > F        =    0.0022
    Residual |  .577223949        22  .026237452   R-squared       =    0.3537
-------------+----------------------------------   Adj R-squared   =    0.3243
       Total |  .893094123        23  .038830179   Root MSE        =    .16198

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |    .352863   .1016981     3.47   0.002     .1419542    .5637719
        _cons |  -.0887701   .0486658    -1.82   0.082    -.1896968    .0121565
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2008

      Source |       SS           df       MS      Number of obs   =        25
-------------+----------------------------------   F(1, 23)        =     13.34
       Model |  .249123411         1  .249123411   Prob > F        =    0.0013
    Residual |  .429597329        23  .018678145   R-squared       =    0.3670
-------------+----------------------------------   Adj R-squared   =    0.3395
       Total |  .678720741        24  .028280031   Root MSE        =    .13667

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3173672   .0869004     3.65   0.001     .1376001    .4971344
        _cons |  -.0889128   .0401841    -2.21   0.037    -.1720399   -.0057857
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2009

      Source |       SS           df       MS      Number of obs   =        25
-------------+----------------------------------   F(1, 23)        =     16.17
       Model |  .265505406         1  .265505406   Prob > F        =    0.0005
    Residual |  .377760381        23  .016424364   R-squared       =    0.4127
-------------+----------------------------------   Adj R-squared   =    0.3872
       Total |  .643265787        24  .026802741   Root MSE        =    .12816

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3411604   .0848528     4.02   0.001      .165629    .5166918
        _cons |  -.0794025   .0389757    -2.04   0.053    -.1600299    .0012249
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2010

      Source |       SS           df       MS      Number of obs   =        25
-------------+----------------------------------   F(1, 23)        =     13.76
       Model |  .271046358         1  .271046358   Prob > F        =    0.0012
    Residual |  .453102305        23    .0197001   R-squared       =    0.3743
-------------+----------------------------------   Adj R-squared   =    0.3471
       Total |  .724148664        24  .030172861   Root MSE        =    .14036

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3652087   .0984586     3.71   0.001     .1615316    .5688857
        _cons |  -.0920145   .0431685    -2.13   0.044    -.1813153   -.0027137
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2011

      Source |       SS           df       MS      Number of obs   =        25
-------------+----------------------------------   F(1, 23)        =     12.08
       Model |  .230944465         1  .230944465   Prob > F        =    0.0020
    Residual |  .439792963        23  .019121433   R-squared       =    0.3443
-------------+----------------------------------   Adj R-squared   =    0.3158
       Total |  .670737428        24  .027947393   Root MSE        =    .13828

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3507859   .1009366     3.48   0.002     .1419827    .5595891
        _cons |  -.0816571   .0434486    -1.88   0.073    -.1715373    .0082232
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2012

      Source |       SS           df       MS      Number of obs   =        25
-------------+----------------------------------   F(1, 23)        =     13.18
       Model |  .249556201         1  .249556201   Prob > F        =    0.0014
    Residual |  .435403115        23   .01893057   R-squared       =    0.3643
-------------+----------------------------------   Adj R-squared   =    0.3367
       Total |  .684959316        24  .028539972   Root MSE        =    .13759

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3835054   .1056256     3.63   0.001     .1650022    .6020085
        _cons |   -.078112   .0426655    -1.83   0.080    -.1663723    .0101483
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2013

      Source |       SS           df       MS      Number of obs   =        27
-------------+----------------------------------   F(1, 25)        =      6.97
       Model |  .162688907         1  .162688907   Prob > F        =    0.0141
    Residual |  .583358966        25  .023334359   R-squared       =    0.2181
-------------+----------------------------------   Adj R-squared   =    0.1868
       Total |  .746047873        26  .028694149   Root MSE        =    .15276

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .2772141   .1049867     2.64   0.014     .0609899    .4934382
        _cons |  -.1105792   .0453511    -2.44   0.022    -.2039815   -.0171769
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2014

      Source |       SS           df       MS      Number of obs   =        27
-------------+----------------------------------   F(1, 25)        =     10.27
       Model |  .204950313         1  .204950313   Prob > F        =    0.0037
    Residual |   .49894273        25  .019957709   R-squared       =    0.2912
-------------+----------------------------------   Adj R-squared   =    0.2628
       Total |  .703893043        26  .027072809   Root MSE        =    .14127

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3221236   .1005203     3.20   0.004     .1150983     .529149
        _cons |  -.0965218   .0424956    -2.27   0.032    -.1840431   -.0090005
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2015

      Source |       SS           df       MS      Number of obs   =        27
-------------+----------------------------------   F(1, 25)        =     11.97
       Model |  .217984892         1  .217984892   Prob > F        =    0.0020
    Residual |  .455364434        25  .018214577   R-squared       =    0.3237
-------------+----------------------------------   Adj R-squared   =    0.2967
       Total |  .673349326        26  .025898051   Root MSE        =    .13496

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3320118   .0959732     3.46   0.002     .1343513    .5296722
        _cons |  -.0862148   .0418073    -2.06   0.050    -.1723185   -.0001111
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2016

      Source |       SS           df       MS      Number of obs   =        27
-------------+----------------------------------   F(1, 25)        =     12.07
       Model |  .222837263         1  .222837263   Prob > F        =    0.0019
    Residual |  .461517255        25   .01846069   R-squared       =    0.3256
-------------+----------------------------------   Adj R-squared   =    0.2986
       Total |  .684354518        26  .026321328   Root MSE        =    .13587

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3378563   .0972438     3.47   0.002     .1375789    .5381337
        _cons |  -.0883848   .0423907    -2.09   0.047    -.1756901   -.0010794
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2017

      Source |       SS           df       MS      Number of obs   =        27
-------------+----------------------------------   F(1, 25)        =     10.96
       Model |  .217735764         1  .217735764   Prob > F        =    0.0028
    Residual |  .496780735        25  .019871229   R-squared       =    0.3047
-------------+----------------------------------   Adj R-squared   =    0.2769
       Total |  .714516499        26  .027481404   Root MSE        =    .14097

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3366355   .1016968     3.31   0.003      .127187    .5460841
        _cons |  -.0916157   .0439542    -2.08   0.048    -.1821411   -.0010903
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved

. drop if year==.
(88 observations deleted)

. 
. use  `phi_byyear', clear

. 
. 
. 
. *-----------------------------------------------------------------
. *Table A4 (part b): coef and standard error per year, for firms that appear every year during the period of analysis
. *-----------------------------------------------------------------
. local nn=10 

. *minimum number of sectors allowed per year-isocode*/
. clear all

. use "${data}/estimates_sec_naics_sales_s1_base_woparent_ctte.dta", clear

. by year isocode, sort: egen num=count( fe_location )

. table isocode year, c(mean  num)

----------------------------------------------------------------------------
          |                               year                              
  isocode | 2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017
----------+-----------------------------------------------------------------
       AT |    7    12    12    16    16    16    16    16    16    16    15
       BE |   12    18    18    18    18    18    18    18    18    18    18
       BG |    1    17    17    17    17    17    17    17    17    17    17
       CZ |   16    18    18    18    18    18    18    18    18    18    17
       DE |   17    18    18    18    18    18    18    18    18    18    15
       EE |    6    17    17    17    17    17    17    17    17    17    16
       ES |   17    18    18    18    18    18    18    18    18    18    18
       FI |    7    18    18    18    18    18    18    18    18    18    18
       FR |   17    18    18    18    18    18    18    18    18    18    18
       GB |   15    18    18    18    18    18    18    18    18    18    18
       GR |   16    17    17    17    17    17    17    17    17    17    16
       HR |    5    17    17    17    17    17    17    17    17    17    17
       HU |   13    18    18    18    18    18    18    18    18    18    18
       IT |   15    18    18    18    18    18    18    18    18    18    18
       JP |          2     3     7     7     7     7     7     7     7     7
       KR |    7    15    15    15    15    15    15    15    15    15    15
       LT |    9    17    16    17    17    17    17    17    17    17    17
       LV |    4    17    17    17    17    17    17    17    17    17    17
       MX |    1     1     1     1     1     1     1     1     1     1     1
       NL |   12    17    17    17    17    17    17    17    17    17    17
       PL |   17    18    18    18    18    18    18    18    18    18    17
       PT |   14    18    18    18    18    18    18    18    18    18    18
       RO |   13    18    19    19    19    19    19    19    19    19    18
       SE |    8    19    19    19    19    19    19    19    19    19    19
       SI |   10    16    16    18    18    18    18    18    18    18    18
       SK |   10    18    18    18    18    18    18    18    18    18    17
----------------------------------------------------------------------------

. keep if num>=`nn'
(126 observations deleted)

. keep year isocode

. duplicates drop 

Duplicates in terms of all variables

(4,170 observations deleted)

. tempfile iso

. save `iso', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000o.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000o.tmp saved

. 
. use "${data}/estimates_agg_naics_sales_s1_base_woparent_ctte.dta", clear

. merge m:1 year isocode using `iso'

    Result                           # of obs.
    -----------------------------------------
    not matched                            30
        from master                        30  (_merge==1)
        from using                          0  (_merge==2)

    matched                               255  (_merge==3)
    -----------------------------------------

. keep if _merge==3
(30 observations deleted)

. drop _merge

. tempfile file_byyear

. save `file_byyear', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000p.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000p.tmp saved

. 
. 
. *-----------------------------------------------------------------
. clear all

. use `file_byyear', clear

. 
. local grvar0 "gdp_pw_ppp" 

. local grvar1 "" 

. local rr ""

. local var3 "A"

. keep if year>=2006 & year<=2017
(0 observations deleted)

. merge m:1 year isocode type using "${data}/aggregates_tfp_lp_klems_agg.dta" 
(note: variable year was float, now double to accommodate using data's values)
(note: variable isocode was str2, now str32 to accommodate using data's values)
(note: variable type was str5, now str9 to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                         2,757
        from master                         0  (_merge==1)
        from using                      2,757  (_merge==2)

    matched                               255  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(2,757 observations deleted)

. drop _merge

. 
. foreach var in D_A  {
  2. gen `var'_phi=(-1)*`var'*(0.2)
  3. *---------------------------------------
. gen b_`var'_phi_`grvar0'=ln_`grvar0' - `var'_phi
  4. }

. 
. local LHS1 D_`var3'_phi

. local LHS2 b_D_`var3'_phi_`grvar0'

. local RHS ln_`grvar0'

.         
. sum `LHS1' `RHS'  `LHS2'

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     D_A_phi |        255   -.2193443    .1476706  -.5635015   .1674325
ln_gdp_pw_~p |        255   -.3336844    .2786597  -1.088261   .0762673
b_D_A_phi_~p |        255   -.1143402    .2268152  -.7894391   .2898045

. local ytitle "{&Delta}`=ustrunescape("\u03D5\u0303")'{sub:n}, {&Delta}`=ustrunescape("\u007A\u0303")'{sub:n}"

. local xtitle "{&Delta}y{sub:n}"

. local firm_emb "{&Delta}`=ustrunescape("\u03D5\u0303")'{sub:n}" 

. local ctry_emb "{&Delta}`=ustrunescape("\u007A\u0303")'{sub:n}"

. 
. tempfile temp

. save `temp', replace 
(note: file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000q.tmp not found)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000q.tmp saved

. 
. 
. 
. forvalues year=2007(1)2017 {
  2. display "`year'"
  3. 
. use `temp', clear
  4. reg `LHS1' `RHS' if year==`year'
  5. mat b = e(b)
  6. mat V = e(V)
  7. global c1: display %-03.2fc round(b[1,1],0.01)
  8. global se1: display %-03.2fc round(sqrt(V[1,1]),0.01)
  9. display "$c1, $se1"
 10. use  `phi_byyear', clear
 11. replace coef_cttesample=$c1 if year==`year'
 12. replace se_cttesample=$se1 if year==`year'
 13. replace num_ctry_cttesample=`e(N)' if year==`year'
 14. save, replace
 15. 
. }
2007

      Source |       SS           df       MS      Number of obs   =        15
-------------+----------------------------------   F(1, 13)        =      3.29
       Model |   .04756325         1   .04756325   Prob > F        =    0.0929
    Residual |  .188035241        13  .014464249   R-squared       =    0.2019
-------------+----------------------------------   Adj R-squared   =    0.1405
       Total |  .235598491        14  .016828464   Root MSE        =    .12027

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .1959071   .1080345     1.81   0.093    -.0374872    .4293013
        _cons |  -.0843343   .0466563    -1.81   0.094    -.1851291    .0164605
-------------------------------------------------------------------------------
0.20, 0.11
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2008

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =      8.17
       Model |  .136878323         1  .136878323   Prob > F        =    0.0091
    Residual |  .368470485        22  .016748658   R-squared       =    0.2709
-------------+----------------------------------   Adj R-squared   =    0.2377
       Total |  .505348809        23  .021971687   Root MSE        =    .12942

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |    .236456   .0827129     2.86   0.009       .06492     .407992
        _cons |  -.1267642   .0389136    -3.26   0.004     -.207466   -.0460624
-------------------------------------------------------------------------------
0.24, 0.08
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2009

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     11.38
       Model |  .153953597         1  .153953597   Prob > F        =    0.0027
    Residual |  .297696686        22  .013531668   R-squared       =    0.3409
-------------+----------------------------------   Adj R-squared   =    0.3109
       Total |  .451650283        23  .019636969   Root MSE        =    .11633

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .2610488   .0773931     3.37   0.003     .1005453    .4215524
        _cons |  -.1159878   .0361435    -3.21   0.004    -.1909449   -.0410308
-------------------------------------------------------------------------------
0.26, 0.08
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2010

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     10.92
       Model |  .191556099         1  .191556099   Prob > F        =    0.0032
    Residual |  .385789676        22  .017535894   R-squared       =    0.3318
-------------+----------------------------------   Adj R-squared   =    0.3014
       Total |  .577345775        23   .02510199   Root MSE        =    .13242

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3085965   .0933699     3.31   0.003     .1149591    .5022338
        _cons |  -.1273335   .0416208    -3.06   0.006    -.2136498   -.0410172
-------------------------------------------------------------------------------
0.31, 0.09
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2011

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =      9.72
       Model |  .158867323         1  .158867323   Prob > F        =    0.0050
    Residual |  .359609378        22  .016345881   R-squared       =    0.3064
-------------+----------------------------------   Adj R-squared   =    0.2749
       Total |  .518476702        23  .022542465   Root MSE        =    .12785

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .2917749   .0935912     3.12   0.005     .0976787    .4858711
        _cons |  -.1234566   .0408807    -3.02   0.006     -.208238   -.0386751
-------------------------------------------------------------------------------
0.29, 0.09
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2012

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     10.41
       Model |  .164888054         1  .164888054   Prob > F        =    0.0039
    Residual |  .348394245        22  .015836102   R-squared       =    0.3212
-------------+----------------------------------   Adj R-squared   =    0.2904
       Total |  .513282299        23  .022316622   Root MSE        =    .12584

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3126826   .0969021     3.23   0.004     .1117199    .5136452
        _cons |  -.1251416   .0397339    -3.15   0.005    -.2075447   -.0427385
-------------------------------------------------------------------------------
0.31, 0.10
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2013

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     12.57
       Model |  .185100087         1  .185100087   Prob > F        =    0.0018
    Residual |  .324043185        22  .014729236   R-squared       =    0.3636
-------------+----------------------------------   Adj R-squared   =    0.3346
       Total |  .509143271        23  .022136664   Root MSE        =    .12136

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |    .325436   .0918021     3.54   0.002     .1350502    .5158218
        _cons |  -.1209883    .038791    -3.12   0.005    -.2014358   -.0405407
-------------------------------------------------------------------------------
0.33, 0.09
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2014

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     13.10
       Model |   .19519969         1   .19519969   Prob > F        =    0.0015
    Residual |  .327867063        22  .014903048   R-squared       =    0.3732
-------------+----------------------------------   Adj R-squared   =    0.3447
       Total |  .523066753        23  .022742033   Root MSE        =    .12208

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3431092   .0948048     3.62   0.002      .146496    .5397223
        _cons |    -.11813   .0394306    -3.00   0.007    -.1999041   -.0363559
-------------------------------------------------------------------------------
0.34, 0.09
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2015

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     16.30
       Model |   .21937761         1   .21937761   Prob > F        =    0.0006
    Residual |  .296108303        22  .013459468   R-squared       =    0.4256
-------------+----------------------------------   Adj R-squared   =    0.3995
       Total |  .515485913        23  .022412431   Root MSE        =    .11601

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3670921    .090927     4.04   0.001      .178521    .5556631
        _cons |  -.1054585   .0387367    -2.72   0.012    -.1857935   -.0251235
-------------------------------------------------------------------------------
0.37, 0.09
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2016

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     18.53
       Model |  .240070749         1  .240070749   Prob > F        =    0.0003
    Residual |  .285062902        22  .012957405   R-squared       =    0.4572
-------------+----------------------------------   Adj R-squared   =    0.4325
       Total |  .525133651        23  .022831898   Root MSE        =    .11383

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .3870787   .0899267     4.30   0.000     .2005821    .5735752
        _cons |  -.0983343   .0383314    -2.57   0.018    -.1778287   -.0188399
-------------------------------------------------------------------------------
0.39, 0.09
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved
2017

      Source |       SS           df       MS      Number of obs   =        24
-------------+----------------------------------   F(1, 22)        =     18.94
       Model |  .261394492         1  .261394492   Prob > F        =    0.0003
    Residual |  .303553594        22  .013797891   R-squared       =    0.4627
-------------+----------------------------------   Adj R-squared   =    0.4383
       Total |  .564948087        23   .02456296   Root MSE        =    .11746

-------------------------------------------------------------------------------
      D_A_phi |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
ln_gdp_pw_ppp |   .4111647   .0944657     4.35   0.000     .2152549    .6070745
        _cons |  -.0936078   .0396866    -2.36   0.028    -.1759127    -.011303
-------------------------------------------------------------------------------
0.41, 0.09
(1 real change made)
(1 real change made)
(1 real change made)
file C:\Users\VANESS~1\AppData\Local\Temp\ST_354_00000k.tmp saved

. 
. use  `phi_byyear', clear

. drop if year==.
(88 observations deleted)

. 
. *Export table to excel
. export delimited using "${rappendix}/table_A4_phi_vs_z_byyear.csv", datafmt replace
(note: file F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/results/appendix/table_A4_phi_vs_z_byyear.csv no
> t found)
file F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/results/appendix/table_A4_phi_vs_z_byyear.csv saved

. 
. log close
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/table_A4_phi_vs_z_byyear.log
  log type:  text
 closed on:  22 Nov 2022, 10:23:46
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
